Video signals have a very large amount of information, and therefore have a high requirement on transmission network bandwidth or media storage space. Therefore, before a video signal is transmitted, the video signal needs to be compressed in order to save transmission network bandwidth or media storage space. A main purpose of video compression is to minimize picture distortion after compression and reconstruction in a specific bitrate.
Conventional intra-frame encoding usually includes many phases such as prediction, transform, quantization, and entropy encoding. Further, intra-frame prediction is performed on a picture block according to reconstructed reference pixels surrounding the picture block. An intra-frame prediction manner includes 33 types of directional prediction, direct current (DC) prediction, or planar prediction in a video compression standard High Efficiency Video Coding (HEVC), prediction that is based on template matching, or the like. Then, subtraction is performed between original pixel values (original pixel value, that is, original values of pixels in the picture block that is not compressed) of the picture block and predicted pixel values (predicted pixel value, that is, predicted values that are of the pixels in the picture block and that are obtained by means of prediction) to obtain residual values of the entire picture block. The residual values are transformed to obtain transform coefficients. Then, the transform coefficients are quantized to obtain quantized transform coefficients. Finally, prediction mode information and residual value information indicated using the quantized transform coefficients are encoded into a bit-stream using an entropy encoding method.
Correspondingly, video decoding is a process of converting a bit-stream into a video picture. Conventional intra-frame decoding includes main phases such as entropy decoding, prediction, dequantization, and inverse transform. First, the bit-stream is parsed by means of entropy decoding processing to obtain encoding mode information and a quantized transform coefficient. Then, on one hand, predicted pixels are obtained using intra-frame prediction mode information and decoded reconstructed pixels, on the other hand, the quantized transform coefficient is dequantized to obtain a reconstructed transform coefficient, and the reconstructed transform coefficient is reversely transformed to obtain information about a reconstructed residual value. Then, the information about the reconstructed residual value and the predicted pixels are added to obtain reconstructed pixels in order to restore the video picture.
Therefore, an existing encoding method is not flexible enough, and is low in encoding efficiency.